package GraphProperties;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import Global.ConstantVariable;
import Global.DirectoryStructureAndSettingsClass;
import Global.GlobalClass;
import SyntheticData.syntheticDataGeneratorClass;
import SyntheticData.syntheticDataGeneratorClass.TogetherFilesHolderClass;
import Utility.ListsPerGivenLevelsHolderClass;
import Utility.WorkerUtilityClass;

public class AccuracyRelatedPropsClass extends GenericGraphPropertyClass implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2214623150249281739L;
	double[] accuracyListOfTheNodes;
	double accuracyOfTheGraph;
	
	double[] accuracyDistrubutionVsDegreeLevels;
	double[] accuracyDistrubutionErrorBarsVsDegreeLevels;
		
	double[] accuracyDistrubutionVsCCLevels;
	double[] accuracyDistrubutionErrorBarsVsCCLevels;
		
	double[] accuracyDistrubutionVsHomophilyLevels;
	double[] accuracyDistrubutionErrorBarsVsHomophilyLevels;
	
	double[] accuracyDistrubutionVsLALevels;
	double[] accuracyDistrubutionErrorBarsVsLALevels;

	/********************************/
	protected AccuracyRelatedPropsClass(PropertiesOfGraphClass propertiesIBelongTo) 
	{
		super(propertiesIBelongTo);
		accuracyOfTheGraph = 0;
	}
	
	public void setAccuracyOfTheNodesAndRelatedParameters(double[] accuracyListOfTheNodes, double accuracyOfTheGraph)
	{
		this.accuracyListOfTheNodes = accuracyListOfTheNodes;			
		this.accuracyOfTheGraph = accuracyOfTheGraph;
		calculateAccuracyVsDegreeDistribution();
		calculateAccuracyVsCCDistribution();
		calculateAccuracyVsHomophilyDistribution();
		calculateAccuracyVsLADistribution();  
		//accuracyCalculationIsCompleted();
	}
	
	public void setAccuracyVsCCRelatedParameters(double[] accuracyDistrubutionVsCCLevels, double[] accuracyDistrubutionErrorBarsVsCCLevels)
	{
		this.accuracyDistrubutionVsCCLevels = accuracyDistrubutionVsCCLevels;			
		this.accuracyDistrubutionErrorBarsVsCCLevels = accuracyDistrubutionErrorBarsVsCCLevels;
		//accuracyCalculationIsCompleted();		
	}
	
	public void setAccuracyVsHomophilyRelatedParameters(double[] accuracyDistrubutionVsHomophilyLevels, double[] accuracyDistrubutionErrorBarsVsHomophilyLevels)
	{
		this.accuracyDistrubutionVsHomophilyLevels = accuracyDistrubutionVsHomophilyLevels;			
		this.accuracyDistrubutionErrorBarsVsHomophilyLevels = accuracyDistrubutionErrorBarsVsHomophilyLevels;
		//accuracyCalculationIsCompleted();		
	}
	
	public void setAccuracyVsLARelatedParameters(double[] accuracyDistrubutionVsLALevels, double[] accuracyDistrubutionErrorBarsVsLALevels)
	{
		this.accuracyDistrubutionVsLALevels = accuracyDistrubutionVsLALevels;			
		this.accuracyDistrubutionErrorBarsVsLALevels = accuracyDistrubutionErrorBarsVsLALevels;
		accuracyCalculationIsCompleted();		
	}
		
	public void setAccuracyVsDegreeDistribution(double[] accuracyDistrubutionVsDegreeLevels)
	{
		this.accuracyDistrubutionVsDegreeLevels = accuracyDistrubutionVsDegreeLevels;				
	}
	
	public double[] getAccuracyListOfTheNodes()
	{
		return accuracyListOfTheNodes;
	}
	
	public double getAccuracyOfTheGraph()
	{
		return accuracyOfTheGraph;
	}
		
	public double[] getAccuracyVsDegreeDistribution()
	{
		return accuracyDistrubutionVsDegreeLevels;
	}
	
	void calculateAccuracyVsCCDistribution()
	{
		double[] degreeListOfTheNodes = propertiesIBelongTo.degreeDistributionRelatedProps.degreeListOfNodes;
		//double[] ccListOfTheNodes = propertiesIBelongTo.clusteringCoefficientRelatedProps.clusteringCoefficientListOfTheNodes;    	
		double[] accuracyListOfTheNodes = propertiesIBelongTo.accuracyRelatedProps.accuracyListOfTheNodes;    	
		double[] ccLevels=propertiesIBelongTo.clusteringCoefficientRelatedProps.ccLevels;
		int numberOfCCLevels = ccLevels.length;
		
		double[] clusteringCoefficientListOfTheNodes = propertiesIBelongTo.clusteringCoefficientRelatedProps.clusteringCoefficientListOfTheNodes;

		Map<Double, Integer> ccDistibutionMapIndex = new HashMap<Double, Integer>();

		for(int i=0; i<numberOfCCLevels; i++)
			ccDistibutionMapIndex.put(ccLevels[i], i);

		int indexOfTheCCDistList;

		ListsPerGivenLevelsHolderClass[] clusteringCoefficientLists = ListsPerGivenLevelsHolderClass.getNewLevelSeperatedList(numberOfCCLevels);


		int i=0;
		int magnifyingConstant =(int)(1.0/ConstantVariable.ClusteringCoefficentRelated_ConstantVariables.PRECISION_LEVEL_FOR_CC_DISCRETIZATON); 
		try{

			for(i=0; i<degreeListOfTheNodes.length; i++)
			{
				if(degreeListOfTheNodes[i]> 1)
				{	try
					{
						
						indexOfTheCCDistList = ccDistibutionMapIndex.get((double)((int)(clusteringCoefficientListOfTheNodes[i]*magnifyingConstant))/magnifyingConstant);
						clusteringCoefficientLists[indexOfTheCCDistList].add(accuracyListOfTheNodes[i]);
					}catch (Exception e) {
						// TODO: handle exception
						System.out.println("Org deger:"+clusteringCoefficientListOfTheNodes[i]);
						System.out.println("Yuvarlanan:"+(double)((int)(clusteringCoefficientListOfTheNodes[i]*magnifyingConstant))/magnifyingConstant);
						e.printStackTrace();
					}
				}
			}
		}catch (Exception e) {
			System.out.println("i:"+i);
			System.out.println("accListOfTheNodes[i]:"+degreeListOfTheNodes[i]);
			e.printStackTrace();
			// TODO: handle exception
		}

		double[] accuracyDistrubutionVsCCLevels;
		double[] accuracyDistrubutionErrorBarsVsCCLevels;

		accuracyDistrubutionVsCCLevels = new double[numberOfCCLevels];
		accuracyDistrubutionErrorBarsVsCCLevels = new double[numberOfCCLevels];


		double[] doubleArrayFormOfTheList; 

		for(i=0; i<clusteringCoefficientLists.length; i++)
		{
			doubleArrayFormOfTheList = WorkerUtilityClass.getDoubleArrayFromDoubleArrayList(clusteringCoefficientLists[i].getArrayListOfTheDoubleValues());
			accuracyDistrubutionVsCCLevels[i]=WorkerUtilityClass.getAverage(doubleArrayFormOfTheList);
			accuracyDistrubutionErrorBarsVsCCLevels[i]=WorkerUtilityClass.findErrorBar(doubleArrayFormOfTheList);
			//System.out.println("i:"+i+":"+clusteringCoefficientLists[i].size() +":"+clusteringCoefficientDistrubutionErrorBarsVsDegreeLevels[i]);
		}	

		setAccuracyVsCCRelatedParameters(accuracyDistrubutionVsCCLevels, accuracyDistrubutionErrorBarsVsCCLevels);
	}

	void calculateAccuracyVsHomophilyDistribution()
	{
		double[] degreeListOfTheNodes = propertiesIBelongTo.degreeDistributionRelatedProps.degreeListOfNodes;
		//double[] ccListOfTheNodes = propertiesIBelongTo.clusteringCoefficientRelatedProps.clusteringCoefficientListOfTheNodes;    	
		double[] accuracyListOfTheNodes = propertiesIBelongTo.accuracyRelatedProps.accuracyListOfTheNodes;    	
		double[] homophilyLevels=propertiesIBelongTo.homophilyRelatedProps.homophilyLevels;

		double[] homophilyListOfTheNodes = propertiesIBelongTo.homophilyRelatedProps.homophilyListOfTheNodes;
		int numberOfHomophilyLevels = homophilyLevels.length;

		Map<Double, Integer> homophilyDistibutionMapIndex = new HashMap<Double, Integer>();

		for(int i=0; i<numberOfHomophilyLevels; i++)
			homophilyDistibutionMapIndex.put(homophilyLevels[i], i);

		int indexOfTheHomophilyDistList;

		ListsPerGivenLevelsHolderClass[] homophilyLists = ListsPerGivenLevelsHolderClass.getNewLevelSeperatedList(numberOfHomophilyLevels);


		int i=0;
		int magnifyingConstant =(int)(1.0/ConstantVariable.HomophilyRelated_ConstantVariables.PRECISION_LEVEL_FOR_HOMOPHILY_DISCRETIZATON); 
		try{

			for(i=0; i<degreeListOfTheNodes.length; i++)
			{
				if(degreeListOfTheNodes[i]> 0)
				{	try
				{						
					indexOfTheHomophilyDistList = homophilyDistibutionMapIndex.get(WorkerUtilityClass.roundToDecimals((double)((int)(homophilyListOfTheNodes[i]*magnifyingConstant))/magnifyingConstant,2));
					homophilyLists[indexOfTheHomophilyDistList].add(accuracyListOfTheNodes[i]);
				}catch (Exception e) {
					// TODO: handle exception
					System.out.println("Org deger:"+homophilyListOfTheNodes[i]);
					System.out.println("Yuvarlanan:"+(double)((int)(homophilyListOfTheNodes[i]*magnifyingConstant))/magnifyingConstant);
					e.printStackTrace();
				}
				}
			}
		}catch (Exception e) {
			System.out.println("i:"+i);
			System.out.println("hListOfTheNodes[i]:"+degreeListOfTheNodes[i]);
			e.printStackTrace();
			// TODO: handle exception
		}

		double[] accuracyDistrubutionVsHomophilyLevels;
		double[] accuracyDistrubutionErrorBarsVsHomophilyLevels;

		accuracyDistrubutionVsHomophilyLevels = new double[numberOfHomophilyLevels];
		accuracyDistrubutionErrorBarsVsHomophilyLevels = new double[numberOfHomophilyLevels];


		double[] doubleArrayFormOfTheList; 

		for(i=0; i<homophilyLists.length; i++)
		{
			doubleArrayFormOfTheList = WorkerUtilityClass.getDoubleArrayFromDoubleArrayList(homophilyLists[i].getArrayListOfTheDoubleValues());
			accuracyDistrubutionVsHomophilyLevels[i]=WorkerUtilityClass.getAverage(doubleArrayFormOfTheList);
			accuracyDistrubutionErrorBarsVsHomophilyLevels[i]=WorkerUtilityClass.findErrorBar(doubleArrayFormOfTheList);
			//System.out.println("i:"+i+":"+clusteringCoefficientLists[i].size() +":"+clusteringCoefficientDistrubutionErrorBarsVsDegreeLevels[i]);
		}	

		propertiesIBelongTo.accuracyRelatedProps.setAccuracyVsHomophilyRelatedParameters(accuracyDistrubutionVsHomophilyLevels, accuracyDistrubutionErrorBarsVsHomophilyLevels);
	}
	
	void calculateAccuracyVsLADistribution()
	{
		double[] degreeListOfTheNodes = propertiesIBelongTo.degreeDistributionRelatedProps.degreeListOfNodes;
		//double[] ccListOfTheNodes = propertiesIBelongTo.clusteringCoefficientRelatedProps.clusteringCoefficientListOfTheNodes;    	
		double[] accuracyListOfTheNodes = propertiesIBelongTo.accuracyRelatedProps.accuracyListOfTheNodes;    	
		double[] localAlphaListOfTheNodes = propertiesIBelongTo.localAlphaRelatedProps.localAlphaListOfTheNodes;
		double[] laLevels=propertiesIBelongTo.localAlphaRelatedProps.localAlphaLevels;
		

		int numberOfLALevels = laLevels.length;

		Map<Double, Integer> laDistibutionMapIndex = new HashMap<Double, Integer>();

		for(int i=0; i<numberOfLALevels; i++)
			laDistibutionMapIndex.put(laLevels[i], i);

		int indexOfTheLaDistList;

		ListsPerGivenLevelsHolderClass[] laLists = ListsPerGivenLevelsHolderClass.getNewLevelSeperatedList(numberOfLALevels);


		int i=0;
		int magnifyingConstant =(int)(1.0/ConstantVariable.LocalAlphaRelated_ConstantVariables.PRECISION_LEVEL_FOR_LA_DISCRETIZATON); 
		try{

			for(i=0; i<degreeListOfTheNodes.length; i++)
			{
				if(degreeListOfTheNodes[i]> 0)
				{	try
				{						
					indexOfTheLaDistList = laDistibutionMapIndex.get(WorkerUtilityClass.roundToDecimals((double)((int)(localAlphaListOfTheNodes[i]*magnifyingConstant))/magnifyingConstant,2));
					laLists[indexOfTheLaDistList].add(accuracyListOfTheNodes[i]);
				}catch (Exception e) {
					// TODO: handle exception
					System.out.println("Org deger:"+localAlphaListOfTheNodes[i]);
					System.out.println("Yuvarlanan:"+WorkerUtilityClass.roundToDecimals((double)((int)(localAlphaListOfTheNodes[i]*magnifyingConstant))/magnifyingConstant,2));
					e.printStackTrace();
					System.exit(0);
				}
				}
			}
		}catch (Exception e) {
			System.out.println("i:"+i);
			System.out.println("hListOfTheNodes[i]:"+degreeListOfTheNodes[i]);
			e.printStackTrace();
			// TODO: handle exception
		}

		double[] accuracyDistrubutionVsLALevels;
		double[] accuracyDistrubutionErrorBarsVsLALevels;

		accuracyDistrubutionVsLALevels = new double[numberOfLALevels];
		accuracyDistrubutionErrorBarsVsLALevels = new double[numberOfLALevels];


		double[] doubleArrayFormOfTheList; 

		for(i=0; i<laLists.length; i++)
		{
			doubleArrayFormOfTheList = WorkerUtilityClass.getDoubleArrayFromDoubleArrayList(laLists[i].getArrayListOfTheDoubleValues());
			accuracyDistrubutionVsLALevels[i]=WorkerUtilityClass.getAverage(doubleArrayFormOfTheList);
			accuracyDistrubutionErrorBarsVsLALevels[i]=WorkerUtilityClass.findErrorBar(doubleArrayFormOfTheList);
			//System.out.println("i:"+i+":"+clusteringCoefficientLists[i].size() +":"+clusteringCoefficientDistrubutionErrorBarsVsDegreeLevels[i]);
		}	

		propertiesIBelongTo.accuracyRelatedProps.setAccuracyVsLARelatedParameters(accuracyDistrubutionVsLALevels, accuracyDistrubutionErrorBarsVsLALevels);
	}
	
	void accuracyCalculationIsCompleted()
	{
		String datasetName =DirectoryStructureAndSettingsClass.getDatasetName();
		try {
			
			outForPureRawFile = createRawPureAccuracyResultsFile(datasetName);
			Utility.FileUtilityClass.writeArrayToFile(outForPureRawFile, accuracyListOfTheNodes, ConstantVariable.Format_ConstantVariables.numberFormatToBeUsedForAccuracyOfNodes, "Accuracy of Nodes for " + datasetName+ConstantVariable.Format_ConstantVariables.DASH_CHAR+propertiesIBelongTo.edgeType);
			outForPureRawFile.close();
		
			outForRawFile = createRawAccuracyResultsFile(datasetName);
			Utility.FileUtilityClass.writeTwoArraysToFile(outForRawFile, propertiesIBelongTo.degreeDistributionRelatedProps.degreeLevels, accuracyDistrubutionVsDegreeLevels, ConstantVariable.Format_ConstantVariables.numberFormatToBeUsedForDegreesDistributionLevelsOfNodes, ConstantVariable.Format_ConstantVariables.numberFormatToBeUsedForAccuracyDistributionOfNodes, "Accuracy Of The Graph for " + datasetName+ConstantVariable.Format_ConstantVariables.DASH_CHAR+propertiesIBelongTo.edgeType);
			outForRawFile.close();
			
			String drawingSetting = null;
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_DEGREE_FIGURE_FOR_LINK_GRAPH;
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_DEGREE_FIGURE_FOR_CONTENT_GRAPH;
											
			outForMatlabCodeFile = createMatlabCodeAccuracyVsDDResultsFile(datasetName, false);
			createAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.DefaultScaleTypes.DEFAULT_SCALE_TYPE_TO_BE_USED_WITH_SYNTHETIC_TOGETHER_PLOTS, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);			
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
			
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_DD_MATLAB_FIGURES_TEX_ALL_IN_ONE_FILENAME, false);
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccuracyVsDDPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}
			
					
			/**************************COMBO*********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeAccVsDDComboResultsFile(datasetName, false);
				createAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_DEGREE_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);			
			}
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeAccVsDDComboResultsFile(datasetName, true);
				createAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_DEGREE_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}
				
			outForMatlabCodeFile.close();

			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
				
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_DD_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}
			
			/**************************ACCURACY VS DD DOT PLOTS**************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_DEGREE_FIGURE_FOR_LINK_GRAPH;
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_DEGREE_FIGURE_FOR_CONTENT_GRAPH;
			
			outForMatlabCodeFile = createMatlabCodeDotAccuracyVsDDResultsFile(datasetName, false);
			createDotAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
			
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_DD_MATLAB_FIGURES_TEX_ALL_IN_ONE_FILENAME, false);
			
			/************************** ACCURACY VS DEGREE DOT TOGETHER PLOTS FOR SYNTHETIC*********************************/
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccuracyVsDDDotPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createDotAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}	
			
			/**************************ACCURACY VS DD DOT PLOTS COMBO**************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsDDComboResultsFile(datasetName, false);
				createDotAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_DEGREE_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}		
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsDDComboResultsFile(datasetName, true);
				createDotAccuracyVsDDPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_DEGREE_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);				
			}
			outForMatlabCodeFile.close();
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
				
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_DD_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}
			/****************************ACCURACY VS CC BAR PLOT **********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_CC_FIGURE_FOR_LINK_GRAPH;
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_CC_FIGURE_FOR_CONTENT_GRAPH;
			
			outForMatlabCodeFile = createMatlabCodeAccuracyVsCCResultsFile(datasetName, false);
			createAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
						
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_CC_MATLAB_FIGURES_TEX_IN_ONE_FILENAME, false);
			
			/************************** ACCURACY VS CC BAR TOGETHER PLOTS FOR SYNTHETIC*********************************/
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccVsCCPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}		
			
			/****************************ACCURACY VS CC BAR PLOTS COMBO**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeAccuracyVsCCComboResultsFile(datasetName, false);
				createAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_CC_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);			
			}
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeAccuracyVsCCComboResultsFile(datasetName, true);
				createAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_CC_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}
				
			outForMatlabCodeFile.close();

			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
				
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_CC_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}

			
			/****************************ACCURACY VS CC DOT PLOT**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_CC_FIGURE_FOR_LINK_GRAPH;																													 
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_CC_FIGURE_FOR_CONTENT_GRAPH;
			
			outForMatlabCodeFile = createMatlabCodeDotAccuracyVsCCResultsFile(datasetName, false);
			createDotAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
						
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_CC_MATLAB_FIGURES_TEX_IN_ONE_FILENAME, false);
			
			/************************** ACCURACY VS CC DOT TOGETHER PLOTS FOR SYNTHETIC*********************************/
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccVsCCDotPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createDotAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}
			
			/**************************** ACCURACY VS CC DOT PLOT COMBO**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsCCComboResultsFile(datasetName, false);
				createDotAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_CC_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}		
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsCCComboResultsFile(datasetName, true);
				createDotAccuracyVsCCPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_CC_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);				
			}
			outForMatlabCodeFile.close();
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
			
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_CC_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}
			
			/****************************ACCURACY VS HOMOPHILY BAR PLOT **********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_FIGURE_FOR_LINK_GRAPH;
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_FIGURE_FOR_CONTENT_GRAPH;
			
			outForMatlabCodeFile = createMatlabCodeAccuracyVsHomophilyResultsFile(datasetName, false);
			createAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
						
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_HOMOPHILY_MATLAB_FIGURES_TEX_IN_ONE_FILENAME, false);
			
			/**************************ACCURACY VS HOMOPHILY BAR TOGETHER PLOTS FOR SYNTHETIC*********************************/
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccVsHomophilyPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}		
			
			/****************************ACCURACY VS HOMOPHILY BAR PLOT COMBO**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeAccuracyVsHomophilyComboResultsFile(datasetName, false);
				createAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);			
			}
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeAccuracyVsHomophilyComboResultsFile(datasetName, true);
				createAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}
				
			outForMatlabCodeFile.close();

			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
				
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_HOMOPHILY_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}
			
			/****************************ACCURACY VS HOMOPHILY DOT PLOT**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_FIGURE_FOR_LINK_GRAPH;																													 
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_FIGURE_FOR_CONTENT_GRAPH;
			
			outForMatlabCodeFile = createMatlabCodeDotAccuracyVsHomophilyResultsFile(datasetName, false);
			createDotAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
						
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_HOMOPHILY_MATLAB_FIGURES_TEX_IN_ONE_FILENAME, false);
			
			/**************************ACCURACY VS HOMOPHILY DOT TOGETHER PLOTS FOR SYNTHETIC*********************************/
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccVsHomophilyDotPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createDotAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}
			
			/**************************** ACCURACY VS HOMOPHILY DOT PLOT COMBO**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsHomophilyComboResultsFile(datasetName, false);
				createDotAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}		
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsHomophilyComboResultsFile(datasetName, true);
				createDotAccuracyVsHomophilyPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_HOMOPHILY_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);				
			}
			outForMatlabCodeFile.close();
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
			
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_HOMOPHILY_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}
			
			/****************************ACCURACY VS LOCAL ALPHA BAR PLOT **********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_LA_FIGURE_FOR_LINK_GRAPH;
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_LA_FIGURE_FOR_CONTENT_GRAPH;
			
			outForMatlabCodeFile = createMatlabCodeAccuracyVsLAResultsFile(datasetName, false);
			createAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
						
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_LA_MATLAB_FIGURES_TEX_IN_ONE_FILENAME, false);
			
			/**************************ACCURACY VS LOCAL ALPHA BAR TOGETHER PLOTS FOR SYNTHETIC*********************************/
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccVsLAPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}	
			
			/****************************ACCURACY VS LOCAL ALPHA BAR PLOT COMBO**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeAccuracyVsLAComboResultsFile(datasetName, false);
				createAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_LA_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);			
			}
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeAccuracyVsLAComboResultsFile(datasetName, true);
				createAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_ACCURACY_DISTRIBUTION_VS_LA_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}
				
			outForMatlabCodeFile.close();

			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.ERRORBAR_LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
				
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_LA_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}
		
			/****************************ACCURACY VS LOCAL ALPHA DOT PLOT**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_LA_FIGURE_FOR_LINK_GRAPH;																													 
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
				drawingSetting = ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_LA_FIGURE_FOR_CONTENT_GRAPH;
			
			outForMatlabCodeFile = createMatlabCodeDotAccuracyVsLAResultsFile(datasetName, false);
			createDotAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, false, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.DONT_CARE, drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			outForMatlabCodeFile.close();
			
			outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
			prepareTexFileForTheCreatedMatlabFigure();			
			outForTexForMatlabFigureFile.close();
						
			copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_LA_MATLAB_FIGURES_TEX_IN_ONE_FILENAME, false);
			
			/**************************ACCURACY VS LOCAL ALPHA DOT TOGETHER PLOTS FOR SYNTHETIC*********************************/
			
			//TODO AS EKLEME YAPIYOR..AYNI PARAMETRELI DATASET PLOTLARINI AYNI GRAFTA YAPMA!!!
			if(GlobalClass.RunningValues.executionFor==ConstantVariable.DataSet_Constants.SYNTETIC_DATASET)
			{
				TogetherFilesHolderClass currentTogetherFileHolder;
				currentTogetherFileHolder = syntheticDataGeneratorClass.getOutForMatlabCodeAccVsLADotPDFResultsTogetherFile();
				String nameBackup = new String(matlabFileName);			
				matlabFileName = currentTogetherFileHolder.matlabFileName;
				outForMatlabCodeFile = currentTogetherFileHolder.out;				 
				createDotAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, syntheticDataGeneratorClass.getGraphOrderForTogetherGraphicResults(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE, false), drawingSetting, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, false);
				matlabFileName = nameBackup;
			}
			
			/****************************ACCURACY VS LOCAL ALPHA DOT PLOT COMBO**********************************/
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsLAComboResultsFile(datasetName, false);
				createDotAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.FIRST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_LA_COMBO_FIGURE_FOR_LINK_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);
			}		
			else if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForMatlabCodeFile = createMatlabCodeDotAccuracyVsLAComboResultsFile(datasetName, true);
				createDotAccuracyVsLAPlotCodeForMatlab(outForMatlabCodeFile, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE, true, ConstantVariable.Matlab_ConstantVariables.GraphOrderType.LAST_GRAPH, ConstantVariable.Matlab_ConstantVariables.DrawingSettings.AccRelatedDrawingSettings.DRAWING_SETTING_FOR_DOT_ACCURACY_DISTRIBUTION_VS_LA_COMBO_FIGURE_FOR_CONTENT_GRAPH, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, true);				
			}
			outForMatlabCodeFile.close();
			
			if(propertiesIBelongTo.edgeType==ConstantVariable.Common_ConstantVariables.DEFAULT_EDGE_TYPE_FOR_CONTENT_GRAPH)
			{
				outForTexForMatlabFigureFile = createTexFileForTheGeneratedMatlabFigure(propertiesIBelongTo.edgeType, ConstantVariable.Matlab_ConstantVariables.ScaleType.LINEAR_SCALE);
				prepareTexFileForTheCreatedMatlabFigure();			
				outForTexForMatlabFigureFile.close();
			
				copyTexForTheFigureTo(ConstantVariable.DefaultFileNamesConstants.DefaultAllInOneResultsFiles.ACCURACY_VS_LA_MATLAB_FIGURES_TEX_COMBO_IN_ONE_FILENAME, true);
			}			
			
		} catch (IOException e) {			
			e.printStackTrace();
		}		
	}	
	
	 public BufferedWriter createRawPureAccuracyResultsFile(String datasetName)
	 {
		 String path= DirectoryStructureAndSettingsClass.getFullPathOfTheRootDirectoryNameForTheCurrentDataset()
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderDatasetDirectory.GRAPH_PROPERTIES_FOLDER_NAME
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderGraphPropertiesDirectory.ACCURACY_RELATED_DATA_FOLDER_NAME    				
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderGenericGraphPropertyDirectory.RAW_DATA_FOLDER_NAME;

		 String fileName = datasetName+ConstantVariable.Format_ConstantVariables.DASH_CHAR+propertiesIBelongTo.edgeType+ConstantVariable.Format_ConstantVariables.DASH_CHAR+"AccuracysOfNodes.txt"; 
		
		 return DirectoryStructureAndSettingsClass.createTheFileSpecified(path, fileName, false);
	 }

	 /**********************************************/

	 public BufferedWriter createRawAccuracyResultsFile(String datasetName)
	 {
		 String path= DirectoryStructureAndSettingsClass.getFullPathOfTheRootDirectoryNameForTheCurrentDataset()
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderDatasetDirectory.GRAPH_PROPERTIES_FOLDER_NAME
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderGraphPropertiesDirectory.ACCURACY_RELATED_DATA_FOLDER_NAME
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderGenericGraphPropertyDirectory.RAW_DATA_FOLDER_NAME;

		 String fileName = datasetName+ConstantVariable.Format_ConstantVariables.DASH_CHAR+propertiesIBelongTo.edgeType+ConstantVariable.Format_ConstantVariables.DASH_CHAR+"AccuracyVsDegreeDistribution.txt"; 
		 
		 return DirectoryStructureAndSettingsClass.createTheFileSpecified(path, fileName, false);
	 }
	 
	 /*******************Matlab Files for Clustering Coefficient Versus Accuracy***************************/
	 
	 /********** Accuracy Versus DD Bar Plot Files ****************/
	 public BufferedWriter createMatlabCodeAccuracyVsDDResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_DEGREE_DISTRIBUTION_RESULTS_FILE_SUFFIX, appendMode, true);
	 }
	 
	 public BufferedWriter createMatlabCodeAccVsDDComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_DEGREE_DISTRIBUTION_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 }
	 
	 /********** Accuracy Versus DD Dot Plot Files ****************/
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsDDResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_DEGREE_DISTRIBUTION_RESULTS_FILE_SUFFIX, appendMode, true);
	 }
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsDDComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_DEGREE_DISTRIBUTION_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 }
	 
	 /********** Accuracy Versus CC Bar Plot Files ****************/

	 public BufferedWriter createMatlabCodeAccuracyVsCCResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_CLUSTERING_COEFFICIENT_RESULTS_FILE_SUFFIX, appendMode, true);    	
	 }

	 public BufferedWriter createMatlabCodeAccuracyVsCCComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_CLUSTERING_COEFFICIENT_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 }
	 
	 /********** Accuracy Versus CC Dot Plot Files ****************/
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsCCResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_CLUSTERING_COEFFICIENT_RESULTS_FILE_SUFFIX, appendMode, true);    	
	 } 
	 
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsCCComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_CLUSTERING_COEFFICIENT_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 }
	 
	 /********** Accuracy Versus Homophily Bar Plot Files ****************/
	 
	 public BufferedWriter createMatlabCodeAccuracyVsHomophilyResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_HOMOPHILY_RESULTS_FILE_SUFFIX, appendMode, true);
	 }
	 					   	 
	 public BufferedWriter createMatlabCodeAccuracyVsHomophilyComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_HOMOPHILY_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 }
	 
	 /********** Accuracy Versus Homophily Dot Plot Files ****************/
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsHomophilyResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_HOMOPHILY_RESULTS_FILE_SUFFIX, appendMode, true);    	
	 } 	 
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsHomophilyComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_HOMOPHILY_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 }
	 
	 /********** Accuracy Versus LocalAlpha Bar Plot Files ****************/
	 
	 public BufferedWriter createMatlabCodeAccuracyVsLAResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_LA_RESULTS_FILE_SUFFIX, appendMode, true);
	 }
	 					   	 
	 public BufferedWriter createMatlabCodeAccuracyVsLAComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DISTRIBUTION_VS_LA_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 }
	 
	 /********** Accuracy Versus Local Alpha Dot Plot Files ****************/
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsLAResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_LA_RESULTS_FILE_SUFFIX, appendMode, true);    	
	 } 	 
	 
	 public BufferedWriter createMatlabCodeDotAccuracyVsLAComboResultsFile(String datasetName, boolean appendMode)
	 {
		 return createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(datasetName, ConstantVariable.GraphPropertiesSuffixes.AccPropertiesSuffixes.ACCURACY_DOT_DISTRIBUTION_VS_LA_COMBO_RESULTS_FILE_SUFFIX, appendMode, false);
	 } 
	 
	 
	 public BufferedWriter createMatlabCodeFilesUnderMatlabCodeDirectoryForAccuracy(String datasetName, String suffixForTheFileName, boolean appendMode, boolean includeEdgeType)
	 {
		 String path= DirectoryStructureAndSettingsClass.getFullPathOfTheRootDirectoryNameForTheCurrentDataset()
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderDatasetDirectory.GRAPH_PROPERTIES_FOLDER_NAME
		 +ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderGraphPropertiesDirectory.ACCURACY_RELATED_DATA_FOLDER_NAME;

		 fullPathOfParentDirectoryOfMatlabCode = path;    	
		 path = path + ConstantVariable.DefaultDirectoryNamesConstants.DirectoriesUnderGenericGraphPropertyDirectory.MATLAB_CODE_FOLDER_NAME;

		 String fileName = datasetName+ConstantVariable.Format_ConstantVariables.DASH_CHAR;
		 if(includeEdgeType)
			 fileName += propertiesIBelongTo.edgeType+ConstantVariable.Format_ConstantVariables.DASH_CHAR;
		 fileName +=suffixForTheFileName;    	

		 matlabFileName = fileName;
		 fullPathOfTheMatlabFile = path;

		 fileName += ".m";

		 return DirectoryStructureAndSettingsClass.createTheFileSpecified(path, fileName, appendMode);
	 }
	 /***********************************************************************/
	 void calculateAccuracyVsDegreeDistribution()
	 { 
		 double[] degreeLevels=propertiesIBelongTo.degreeDistributionRelatedProps.degreeLevels;
		 int numberOfDegreeLevels = degreeLevels.length;

		 double[] degreeListOfTheNodes = propertiesIBelongTo.degreeDistributionRelatedProps.degreeListOfNodes;	    	

		 Map<Double, Integer> degreeDistibutionMapIndex = new HashMap<Double, Integer>();

		 for(int i=0; i<numberOfDegreeLevels; i++)
			 degreeDistibutionMapIndex.put(degreeLevels[i], i);

		 int indexOfTheDegreeDistList;
		 
		 ListsPerGivenLevelsHolderClass[] accuracyLists = ListsPerGivenLevelsHolderClass.getNewLevelSeperatedList(numberOfDegreeLevels);
		 
		 for(int i=0; i<degreeListOfTheNodes.length; i++)
		 {
			 if(degreeListOfTheNodes[i]!=0)
			 {
				 indexOfTheDegreeDistList = degreeDistibutionMapIndex.get(WorkerUtilityClass.convertToSomeScale(degreeListOfTheNodes[i]));
				 accuracyLists[indexOfTheDegreeDistList].add(accuracyListOfTheNodes[i]);				 
			 }
		 }
		 
		 accuracyDistrubutionVsDegreeLevels = new double[numberOfDegreeLevels];
		 accuracyDistrubutionErrorBarsVsDegreeLevels = new double[numberOfDegreeLevels];
		 
		 double[] doubleArrayFormOfTheList; 
		 
		 for(int i=0; i<accuracyLists.length; i++)
		 {
			 doubleArrayFormOfTheList = WorkerUtilityClass.getDoubleArrayFromDoubleArrayList(accuracyLists[i].getArrayListOfTheDoubleValues());
			 accuracyDistrubutionVsDegreeLevels[i]=WorkerUtilityClass.getAverage(doubleArrayFormOfTheList);
			 accuracyDistrubutionErrorBarsVsDegreeLevels[i]=WorkerUtilityClass.findErrorBar(doubleArrayFormOfTheList);
			 //System.out.println("i:"+i+":"+accuracyLists[i].size() +":"+accuracyDistrubutionErrorBarsVsDegreeLevels[i]);
		 }
	 }
	 
	 void createAccuracyVsDDPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {    	
		double[] degreeLevels = propertiesIBelongTo.degreeDistributionRelatedProps.degreeLevels;
	    createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, degreeLevels, accuracyDistrubutionVsDegreeLevels, accuracyDistrubutionErrorBarsVsDegreeLevels, "Acc. vs Degree Distribution", "Degree (D)", "Accuracy (Acc)", drawingSettings, ConstantVariable.Matlab_ConstantVariables.DistributionType.PDF_TYPE, generateFigure);
	 }	 
	 
	 void createDotAccuracyVsDDPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {    	
		 double[] degreeList = propertiesIBelongTo.prepareForCorrelationCalculation(propertiesIBelongTo.degreeDistributionRelatedProps.degreeListOfNodes, 1);
		 double[] cleanedAccuracyListOfTheNodes = propertiesIBelongTo.prepareForCorrelationCalculation(accuracyListOfTheNodes, 1);
		 createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, degreeList, cleanedAccuracyListOfTheNodes, null, "Accuracy vs Degree", "Degree (D)", "Accuracy (a)", drawingSettings, distributionPlotType, generateFigure);
	 }
	 
	 void createAccuracyVsCCPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {   
		 double[] ccLevels = propertiesIBelongTo.clusteringCoefficientRelatedProps.ccLevels;
		 createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, ccLevels, accuracyDistrubutionVsCCLevels, accuracyDistrubutionErrorBarsVsCCLevels, "Accuracy vs Clustering Coefficient", "Clustering Coefficient (C)", "Accuracy (a)", drawingSettings, distributionPlotType, generateFigure);
	 }
	 
	 void createDotAccuracyVsCCPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {    	
		 double[] clusteringCoefficientsOfTheNodes = propertiesIBelongTo.clusteringCoefficientRelatedProps.clusteringCoefficientListOfTheNodes;    	
		 createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, clusteringCoefficientsOfTheNodes, accuracyListOfTheNodes, null, "Accuracy vs Clustering Coefficient", "Clustering Coefficient(C)", "Accuracy (a)", drawingSettings, distributionPlotType, generateFigure);
	 }
	 
	 void createAccuracyVsHomophilyPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {   
		 double[] homophilyLevels = propertiesIBelongTo.homophilyRelatedProps.homophilyLevels;
		 createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, homophilyLevels, accuracyDistrubutionVsHomophilyLevels, accuracyDistrubutionErrorBarsVsHomophilyLevels, "Accuracy vs Homophily", "Homophily (H)", "Accuracy (a)", drawingSettings, distributionPlotType, generateFigure);
	 }
	 
	 void createDotAccuracyVsHomophilyPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {    	
		 double[] homophilyOfTheNodes = propertiesIBelongTo.homophilyRelatedProps.homophilyListOfTheNodes;    	
		 createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, homophilyOfTheNodes, accuracyListOfTheNodes, null, "Accuracy vs Homophily", "Homophily (H)", "Accuracy (a)", drawingSettings, distributionPlotType, generateFigure);
	 }
	 
	 void createAccuracyVsLAPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {   
		 double[] localAlphaLevels = propertiesIBelongTo.localAlphaRelatedProps.localAlphaLevels;
		 createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, localAlphaLevels, accuracyDistrubutionVsLALevels, accuracyDistrubutionErrorBarsVsLALevels, "Accuracy vs Local Alpha", "Local Alpha(A)", "Accuracy (a)", drawingSettings, distributionPlotType, generateFigure);
	 }
	 
	 void createDotAccuracyVsLAPlotCodeForMatlab(BufferedWriter outForMatlabCodeFile, int type, boolean isForCombo, int order, String drawingSettings, int distributionPlotType, boolean generateFigure)
	 {    	
		 double[] localAlphaListOfTheNodes = propertiesIBelongTo.localAlphaRelatedProps.localAlphaListOfTheNodes;    	
		 createPlotCodeForMatlab(outForMatlabCodeFile, type, isForCombo, order, localAlphaListOfTheNodes, accuracyListOfTheNodes, null, "Accuracy vs Local Alpha", "Local Alpha (A)", "Accuracy (a)", drawingSettings, distributionPlotType, generateFigure);
	 }
}
